﻿//
// <author>David Nohejl</author>
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WPFTrees.DataStructures
{
    /// <summary>
    /// Class aggregating informations about tree.
    /// </summary>
    /// <typeparam name="U">Type of tree nodes.</typeparam>
    public class TreeInfo<U> where U : IComparable<U>
    {
        /// <summary>
        /// Maximalni hloubka stromu.
        /// </summary>
        public int MaxDepth;     
   
        /// <summary>
        /// Kolekce listu stromu.
        /// </summary>
        public List<NTreeNode<U>> Leaves;

        /// <summary>
        /// true pokud je strom binarni, tzn. kazdy uzel ma max. 2 syny.
        /// </summary>
        public bool IsBinary;

        /// <summary>
        /// maximalni soucet delek hran od korene k listu
        /// </summary>
        public double MaxDepthInUnits;

        /// <summary>
        /// Path to file containing tree.
        /// </summary>
        public string Path;     

        /// <summary>
        /// Size of file containing tree (in bytes)
        /// </summary>
        public long Size
        {
            get {
                if (Path != null)
                {
                    System.IO.FileInfo fi = new System.IO.FileInfo(Path);
                    return fi.Length;
                }
                else return 0;
            }
        }

        /// <summary>
        /// Inicializes new instance of TreeInfo.
        /// </summary>
        public TreeInfo()
        {
            Leaves = new List<NTreeNode<U>>();
        }
    }
}
